import storage from 'good-storage'
export default {
  namespaced: true,
  state: {
    token: '',
    userInfo: {}
  },
  getters: {
    token: state => state.token,
    userInfo: state => state.userInfo,
  },
  mutations: {
    setToken(state, string) {
      storage.set('token', string)
      state.token = string
    },
    setUserInfo(state, object) {
      storage.set('token', object)
      state.userInfo = object
    }
  }
}
